<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "order_product".
 *
 * @property integer $id
 * @property string $order_id
 * @property integer $product_id
 * @property integer $product_num
 * @property string $price
 * @property string $total_price
 */
class OrderProduct extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'order_product';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['order_id', 'product_id', 'product_num', 'price', 'total_price'], 'required'],
            [['order_id', 'product_id', 'product_num'], 'integer'],
            [['price', 'total_price'], 'number'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'order_id' => '订单id',
            'product_id' => '商品id',
            'product_num' => '商品数量',
            'price' => '商品单价',
            'total_price' => '商品总价',
        ];
    }
}
